WorkBookOCX
Version 1.0
12/15/98
Description:
WorkbookOCX is a control designed to emulate the tabular WorkSheet
interface found in Microsoft Excel WorkBooks. Each WorkBook can contain many
WorkSheets. The names of the WorkSheets appear on tabs within the WorkBookOCX
control. To move from WorkSheet to WorkSheet, click the WorkSheet tabs, or scroll
the desired WorkSheet into position. The name of the active WorkSheet appears in
bold. WorkBookOCX also implements horizontal scrolling.
Custom
Properties:
ScrollWrap - Determines whether or not WorkSheet scrolling is
continuous.
ShowHorizontalScrollBar - Determines whether or not the horizontal scrollbar is
displayed.
HLargeChange - Horizontal scrollbar largechange.
HMax - Horizontal scrollbar maximum value.
HMin - Horizontal scrollbar minimum value.
HSmallChange - Horizontal scrollbar smallchange.
HValue - Horizontal scrollbar value.
WorkSheetFont - Font used for WorkSheet display.
ActiveWorkSheet - Returns/sets the ActiveWorkSheet within the WorkBook.
WorkSheetCount - Returns the total number of WorkSheets within the WorkBook.
WorkSheetCaptions - The captions for the WorkSheets. These are comma
seperated...eg., WorkSheet1,WorkSheet2, WorkSheet3.
CursorStyle - Returns/sets the Cursor appearance for the horizontal splitter bar.
SplitterStyle - Returns/sets the graphical appearance and behavior of the splitter
bar.
Event Declarations:
Event SheetSwitch(ByVal nIndex As Double) - Occurs when a
WorkSheet is selected.
Event HScrollChange() - Occurs when the contents of a control have changed.
Event HScroll() - Occurs when you reposition the scroll box on a control.
Sample Code:
'Assuming an array of three
pictureboxes.
'Picture1(0), Picture1(1), Picture1(2)
Private Sub Form_Resize()
On Error Resume Next
With WorkBook1
.Top = ScaleHeight - WorkBook1.Height
.Left = ScaleLeft
.Width = ScaleWidth
End With
Dim i As Integer
For i = 0 To Picture1.Count - 1
With Picture1(i)
.Left = ScaleLeft
.Width = ScaleWidth
.Top = ScaleTop
.Height = ScaleHeight - WorkBook1.Height
.BorderStyle = 1
End With
Next
Picture1(WorkBook1.ActiveWorkSheet - 1).Visible = True
Picture1(WorkBook1.ActiveWorkSheet - 1).ZOrder 0
End Sub
Private Sub WorkBook1_SheetSwitch(ByVal nIndex As Double)
Picture1(WorkBook1.ActiveWorkSheet - 1).Visible = True
Picture1(WorkBook1.ActiveWorkSheet - 1).ZOrder 0
'or
Picture1(nIndex - 1).Visible = True
Picture1(nIndex - 1).ZOrder 0
End Sub
Registering
the control:
Use RegSvr32 or the Browse button in
the Components dialog box within VB5/6 to
register the control.
Licensing and Distribution Agreement:
The WorkBookOCX control is
provided as freeware to developers who are solely responsible for
determining the suitability of the control for their use.
Question, comments,
suggestions, and bug reports:
webmaster@nickerson.org
Copyright ⌐ 1998 Galen Nickerson
http://www.nickerson.org/